﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TaskManager.Data;

using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;

namespace TaskManager.ViewModels
{
    public class Navigation
    {
        public IList<Developer> Developers
        {
            get
            {
                IList<Developer> developers = null;

                using (IUnityContainer container = new UnityContainer())
                {
                    container.LoadConfiguration();
                    ISprintRepository sprintRepository = container.Resolve<ISprintRepository>();
                    developers = sprintRepository.GetDevelopers();
                }
                return developers;
            }
        }

        public IList<Sprint> Sprints
        {
            get
            {
                IList<Sprint> sprints = null;

                using (IUnityContainer container = new UnityContainer())
                {
                    container.LoadConfiguration();
                    ISprintRepository sprintRepository = container.Resolve<ISprintRepository>();
                    sprints = sprintRepository.GetSprints();
                }
                return sprints;
            }
        }
    }
}